From 7bffd29b93cb45cd6882f1f406adcdee5fb59bcd Mon Sep 17 00:00:00 2001 From: Sune Vuorela Date: Tue, 29 Jul 2025 14:14:00 +0200 Subject: [PATCH] [PATCH] Fix crash in pdfseparate Don't continue recursing in PDFDoc::mark* if things looks a bit weirder than expected Gbp-Pq: Name CVE-2025-50420.patch --- poppler/PDFDoc.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/poppler/PDFDoc.cc b/poppler/PDFDoc.cc index f0dae9b..7294d2c 100644 --- a/poppler/PDFDoc.cc +++ b/poppler/PDFDoc.cc @@ -1857,6 +1857,15 @@ bool PDFDoc::markAnnotations(Object *annotsObj, XRef *xRef, XRef *countRef, unsi if (obj1.isDict()) { Dict *dict = obj1.getDict(); Object type = dict->lookup("Type"); + if (type.isNull()) { + Object subType = dict->lookup("SubType"); + // Type is optional, subtype is required + // If neither of them exists, something is probably + // weird here, so let us just skip this entry + if (subType.isNull()) { + continue; + } + } if (type.isName() && strcmp(type.getName(), "Annot") == 0) { const Object &obj2 = dict->lookupNF("P"); if (obj2.isRef()) { -- 2.30.2